package com.wmx.rocketmq;

import org.apache.commons.lang3.time.DateUtils;
import org.junit.jupiter.api.Test;
import org.springframework.util.ObjectUtils;

import java.text.ParseException;
import java.util.Date;

/**
 * @author wangMaoXiong
 * @version 1.0
 * @date 2020/12/11 15:19
 */
public class Wang {
    @Test
    public void test2() throws ParseException {
        String[] DATE_PARSE_PATTERNS = {"yyyy-MM-dd", "yyyy/MM/dd", "yyyy-MM-dd HH:mm", "yyyy/MM/dd HH:mm", "yyyy-MM-dd HH:mm:ss", "yyyy/MM/dd HH:mm:ss"};

        Date date = DateUtils.parseDate("2025-12-31", "yyyy-MM-dd");
        String fieldValue = date.toString();
        Date parseDate = DateUtils.parseDate(fieldValue, DATE_PARSE_PATTERNS);
        System.out.println(parseDate);

        ObjectUtils.isEmpty("");

    }
}
